{% extends 'index.html' %}

{% block title %}
FuSite-工具-AI智能绘画
{% endblock %}

{% block head %}
{% endblock %}

{% block content %}
<div class="box mt-6 ml-6 mr-6">
    <form action="" method="post" onsubmit="jz()">
        <input type="text" name="text" id="text" class="input is-fullwidth {{ username|color }} mt-3" required value="{{ text }}" placeholder="请输入要绘画的内容">
        <div class="select is-fullwidth {{ username|color }} mt-3">
            <select name="size" required>
                {% for i in ["1024x1024", "512x512", "256x256"] %}
                    {% if i == size %}
                        <option value="{{ i }}" selected>{{ i }}</option>
                    {% else %}
                        <option value="{{ i }}">{{ i }}</option>
                    {% endif %}
                {% endfor %}
            </select>
        </div>
        <input type="submit" value="提交" class="button is-fullwidth {{ username|color }} mt-3">
    </form>
</div>

{% if url %}
    <div class="box mt-6 ml-6 mr-6">
        <img src="{{ url }}" style="display: block; margin-left: auto; margin-right: auto;">
    </div> 
{% endif %}

<script>
    function jz(){
        mui.alert("加载的时间可能较长\n请耐心等待~");
    }
</script>

{% endblock %}